package src.main.java.org.io;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;

/*
* 字符缓冲流
* */
public class Test10 {
    public static void main(String[] args) {
        try(
                BufferedReader bufferedReader = new BufferedReader(new FileReader("E:\\JavaLearn\\javaCode\\src\\test3.txt"));
                BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter("E:\\JavaLearn\\javaCode\\src\\test5.txt"))
        ){
           /* char[] chars = new char[3];
            int len;
            while((len = bufferedReader.read(chars))!=-1){
                bufferedWriter.write("E:\\JavaLearn\\javaCode\\src\\test4.txt");
            }*/

            String line;//记住每次读取的一行数据
            while((line = bufferedReader.readLine())!=null){
                bufferedWriter.write(line);
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
